package com.sskj.mine.presenter;

import com.lzy.okrx2.adapter.FlowableBody;
import com.sskj.common.base.HttpData;
import com.sskj.lib.http.JsonConverter;
import com.sskj.mine.bean.AssetBean;
import com.sskj.mine.ui.activity.AssetsActivity;

import java.util.List;

import io.reactivex.Flowable;


public class AssetsActivityPresenter extends BasePresenter<AssetsActivity> {


    /**
     * 获取资产列表
     *
     * @return
     */
    public Flowable<List<AssetBean>> getAssets() {
        return httpService.getAssets()
                .converter(new JsonConverter<HttpData<List<AssetBean>>>() {
                })
                .adapt(new FlowableBody<>())
                .map(HttpData::getData);
    }

}
